package work;

public class UseCompute {
    public void useCom(Compute compute,int one,int two){
        System.out.println("计算结果为：" + compute.computer(one,two));
    }
}
/* 匿名内部类课堂练习
class Plus implements Compute{

    @Override
    public int computer(int n, int m) {
        return n + m;
    }
}

class Minus implements Compute{

    @Override
    public int computer(int n, int m) {
        return n - m;
    }
}

class Multiply implements Compute{
    @Override
    public int computer(int n, int m) {
        return n * m;
    }
}

class Divide implements Compute{
    @Override
    public int computer(int n, int m) {
        return n / m;
    }
}

 */